#!/usr/bin/python
#encoding=utf-8

import time
from wm.lib.phone.jpush import JPushClient

'''
手机客户端预警
'''
class JpushAlarm(object):
    ''' Tools for jpush send aler message to mobilephoe'''
    appKey = '3bd27ef285146efa3c387738'
    masterSecret = '85fc679341e85071b80a3ebb'
    
    def __init(self):
        pass
    
    def sendMessage(self,alias,msg_title,msg_content,extras={}):
        jpush = JPushClient(self.masterSecret)
        sendno = int(time.time())
        jpush.send_notification_by_alias(alias, self.appKey, sendno, 'des', msg_title, msg_content, 'android',extras=extras)

jpushalarm = JpushAlarm()

if __name__ == "__main__": 
    jpush = JpushAlarm()
    alias = '15158064427'
    jpush.sendMessage(alias, 'title', 'main alert conteng ')
